//
//  DeviceListCell.m
//  Lightthings
//
//  Created by Hero on 2024/11/22.
//

#import "DeviceListCell.h"
#import "HomeDeviceViewModel.h"

@implementation DeviceListCell

- (void)setModel:(HomeDeviceViewModel *)model {
    [super setModel:model];
    
    self.nameLab.text = model.name;
//    self.icon.image = U_imageNamed(model.img);
    if (model.type == 5) {
        self.icon.image = U_imageNamed(@"止鼾枕设备");
    }else if (model.type == 1000) {
        self.icon.image = U_imageNamed(@"添加＋");
    }else {
        self.icon.image = U_imageNamed(@"icon_watch_style_2");
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.layer.cornerRadius = 20;
    JYGradientView * gradient  = [[JYGradientView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - 40, self.frame.size.height)];
    gradient.colorsBlock(@[@"#F4FBFC",@"#FEF9FB"]);
    gradient.pointBlock(CGPointMake(0, 0), CGPointMake(1, 0));
    [self.contentView insertSubview:gradient atIndex:0];
    
    // Initialization code
}

@end
